﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="ContactLookup.aspx.cs" Inherits="MockPrjTeam1.Pages.Views.ContactLookup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="templatemo_main">
        <div style="color: #000000; font-weight: bold">
            <br />
            <table class="tablesort">
                <tr>
                    <td class="style12">
                        FirstName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="textbox" TabIndex="1"></asp:TextBox>
                    </td>
                    <td class="style12">
                        SurName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtSurName" runat="server" CssClass="textbox" TabIndex="2"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <br />
            
        
        <table>
        <tr>
            <td>
                <asp:Button ID="btnSearchContact1" Text="Search Contact" runat="server" Width="120px"
                    Height="25px" OnClick="btnSearchContact1_Click" />
            </td>
        </tr>
        </table>
    </div>
    <asp:GridView ID="grvLookupContact" Width="800px" runat="server" AllowPaging="True"
        AutoGenerateColumns="False" Style="margin-top: 0px" ShowHeaderWhenEmpty="True"
        OnPageIndexChanging="grvLookupContact_PageIndexChanging" OnSelectedIndexChanged="grvLookupContact_SelectedIndexChanged"
        EnableModelValidation="True" OnPageIndexChanged="grvLookupContact_SelectedIndexChanged"
        DataKeyNames="ContactID">
        <Columns>
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <center>
                        <input type="radio" class="selectradio" id="<%# Eval("ContactID") %>" name='SuppliersGroup'
                            value="<%# Eval("ContactName") %>" /></center>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName">
                <ControlStyle BorderColor="White" />
                <FooterStyle BackColor="White" />
            </asp:BoundField>
            <asp:BoundField DataField="MobilePhone" HeaderText="Mobile Phone" SortExpression="MobilePhone" />
            <asp:BoundField DataField="EmailAddress" HeaderText="Email Address" SortExpression="EmailAddress" />
            <asp:BoundField DataField="ContactType" HeaderText="Contact Type" SortExpression="ContactType" />
            <asp:BoundField DataField="Active" HeaderText="Is Active" SortExpression="Active" />
        </Columns>
    </asp:GridView>
    <br />
    <table>
        <tr>
            <td>
            
                <input type='button' value='Select' onclick="javascript:return getSelectedItem();" style = " width:65px; height:25px;" />
               
            </td>
        </tr>
    </table>
    </div>
    <script type='text/javascript'>
        function getSelectedItem() {
            window.opener.document.getElementById("txtManagerName1").value = radioes[i].value;
            var radioes = document.getElementsByClassName('selectradio');
            for (var i = 0; i < radioes.length; i++) {
                if (radioes[i].checked) {
                    alert(radioes[i].value);
                    window.close();
                }
            }
        }        


    </script>

</asp:Content>

